package com.gjm.tool.sign;

/**
 * @Description: 认证相关枚举
 * appSecret生成网址: https://www.lddgo.net/encrypt/rsakey
 * @Author: gjm
 */
public enum SignEnum {
    GANSU_APP("gansu_wanwei", "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALd53bwTSNErbtnHC3dh75fbGmwyzjzlUPYJS+4u8uaz3yqO9u5s/bioA5hsWAcZGUSnsQccJIcNEW/Z7R3GMq0CAwEAAQ=="),
    ;

    private String appid;
    private String appSecret;

    SignEnum(String appid, String appSecret) {
        this.appid = appid;
        this.appSecret = appSecret;
    }

    public String getAppid() {
        return appid;
    }

    public String getAppSecret() {
        return appSecret;
    }

    /**
     * 获取appSecret
     * @param appid
     * @return
     */
    public static String getAppSecret(String appid) {
        for (SignEnum value : SignEnum.values()) {
            if (value.getAppid().equals(appid)) {
                return value.getAppSecret();
            }
        }
        return "";
    }

    /**
     * 获取appSecret
     * @param appid
     * @return
     */
    public static Boolean appidIsInclude(String appid) {
        for (SignEnum value : SignEnum.values()) {
            if (value.getAppid().equals(appid)) {
                return true;
            }
        }
        return false;
    }
}
